package com.lyc.day1102.demo7;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @author ：Xiaochen
 * @date ：Created in 2022/11/2 20:02
 * @description：
 * @modified By：
 * @version:
 */
public class Test {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(5);

        for (int i = 0; i < 5; i++) {
            executorService.submit(new Runnable() {
                @Override
                public void run() {
                    System.out.println(Thread.currentThread().getName()+"----------");
                }
            });
        }
        executorService.shutdown();

            boolean shutdown = executorService.isShutdown();
            System.out.println(shutdown);

            //判断线程池是否中止----里面的任务执行完毕
        boolean b = executorService.isTerminated();
        System.out.println(b);

    }
}